package com.modular.extra.ai.task;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.log.StaticLog;
import ntd.remote.file.ComRemoteFile;
import ntd.remote.file.bo.ComRemoteFileBO;
import ntd.util.frame.storage.tool.ToolStorage;

import static ntd.remote.link.ComRegistryClient.run;

/**
 * @author: liuwenju
 * @date: 2023/6/8 14:16
 * @version: 1.0
 */
public class Test {

    public static void main(String[] args) {
        ThreadUtil.execAsync(() -> run("client-ai-test", "测试客户端", "61.52.247.249", 13021));

        ComRemoteFileBO comRemoteFileBO = new ComRemoteFileBO();
        comRemoteFileBO.setPath("D:\\AI_result\\person_image\\20230608\\Person-20230608-202306081413026700pzqdu6whx4yzjq\\1730265478-de8bad8e7c59406a83e09ba51e2eb125-20230608141241-Person-image.jpg");
//            comRemoteFileBO.setPath("D:\\ai-server-async-file-path");
        comRemoteFileBO.setRemoteCode("client-ai-server");
        byte[] bytes = ComRemoteFile.me.readFile(comRemoteFileBO);
        FileUtil.writeBytes(bytes, comRemoteFileBO.getPath());

//        ToolStorage.save("ai-vision", bytes, )
        StaticLog.info("执行完成...");
    }
}
